package com.ruoyi.print.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.print.mapper.SinglePhotoMapper;
import com.ruoyi.print.domain.SinglePhoto;
import com.ruoyi.print.service.ISinglePhotoService;

/**
 * 单个图片任务Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-03
 */
@Service
public class SinglePhotoServiceImpl implements ISinglePhotoService 
{
    @Autowired
    private SinglePhotoMapper singlePhotoMapper;

    /**
     * 查询单个图片任务
     * 
     * @param singlePhotoId 单个图片任务主键
     * @return 单个图片任务
     */
    @Override
    public SinglePhoto selectSinglePhotoBySinglePhotoId(Long singlePhotoId)
    {
        return singlePhotoMapper.selectSinglePhotoBySinglePhotoId(singlePhotoId);
    }

    /**
     * 查询单个图片任务列表
     * 
     * @param singlePhoto 单个图片任务
     * @return 单个图片任务
     */
    @Override
    public List<SinglePhoto> selectSinglePhotoList(SinglePhoto singlePhoto)
    {
        return singlePhotoMapper.selectSinglePhotoList(singlePhoto);
    }

    /**
     * 新增单个图片任务
     * 
     * @param singlePhoto 单个图片任务
     * @return 结果
     */
    @Override
    public int insertSinglePhoto(SinglePhoto singlePhoto)
    {
        return singlePhotoMapper.insertSinglePhoto(singlePhoto);
    }

    /**
     * 修改单个图片任务
     * 
     * @param singlePhoto 单个图片任务
     * @return 结果
     */
    @Override
    public int updateSinglePhoto(SinglePhoto singlePhoto)
    {
        return singlePhotoMapper.updateSinglePhoto(singlePhoto);
    }

    /**
     * 批量删除单个图片任务
     * 
     * @param singlePhotoIds 需要删除的单个图片任务主键
     * @return 结果
     */
    @Override
    public int deleteSinglePhotoBySinglePhotoIds(Long[] singlePhotoIds)
    {
        return singlePhotoMapper.deleteSinglePhotoBySinglePhotoIds(singlePhotoIds);
    }

    /**
     * 删除单个图片任务信息
     * 
     * @param singlePhotoId 单个图片任务主键
     * @return 结果
     */
    @Override
    public int deleteSinglePhotoBySinglePhotoId(Long singlePhotoId)
    {
        return singlePhotoMapper.deleteSinglePhotoBySinglePhotoId(singlePhotoId);
    }

    /**
     * 根据任务ID查询照片列表
     * 
     * @param photoTaskId 照片打印任务主键
     * @return 照片列表
     */
    @Override
    public List<SinglePhoto> selectSinglePhotosByPhotoTaskId(Long photoTaskId)
    {
        SinglePhoto singlePhoto = new SinglePhoto();
        singlePhoto.setPhotoTaskId(photoTaskId);
        return singlePhotoMapper.selectSinglePhotoList(singlePhoto);
    }

    /**
     * 批量删除照片
     * 
     * @param singlePhotoIds 需要删除的照片主键集合
     * @return 结果
     */
    @Override
    public int deleteSinglePhotosBatch(Long[] singlePhotoIds)
    {
        return singlePhotoMapper.deleteSinglePhotoBySinglePhotoIds(singlePhotoIds);
    }
}
